﻿@using KL.Store.Core
@{
    Layout = "~/Views/Shared/" + Parameters.Layout + ".cshtml";
    var cssClass = "col-xs-12 col-sm-12 col-md-3 col-lg-2 left first last";
    var mainWidth = "col-xs-12 col-sm-12 col-md-9 col-lg-10 right";
    var suggestedClass = "col-xs-12 col-sm-12 col-md-12 col-lg-12 right";
    if (Parameters.Theme == "DK" || Parameters.Theme == "EO")
    {
        cssClass = "col-xs-12 col-sm-12 col-md-3 col-lg-3 left first last";
        mainWidth = "col-xs-12 col-sm-12 col-md-9 col-lg-9 right";
    }
    else if (Parameters.Theme == "WU")
    {
        cssClass = "col-xs-12 col-sm-12 col-md-4 col-lg-3 left";
        mainWidth = "col-xs-12 col-sm-12 col-md-8 col-lg-9 right";
        suggestedClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 right";
    }
}
<div class="@cssClass">
    @{ Html.RenderAction("Categories", "Partials"); }
</div>
<div class="contentCampaignsPage">
    @if (Parameters.Theme != "HA")
    {
        <div class="@mainWidth">
            <div class="breadcrumb orderProducts">
                <div class="bcBorder"></div>
                <div class="bcLinks left">
                    <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                        <a href="/" itemprop="url">
                            <span itemprop="title">Anasayfa</span>
                        </a>›
                    </div>
                    <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                        <a href="/Campaigns.html" itemprop="url">
                            <span itemprop="title">Kampanyalar</span>
                        </a>
                    </div>
                </div>
                <div class="bcBorder"></div>
                <div class="clearfix"></div>
            </div>
        </div>
    }
    @if (!string.IsNullOrEmpty(Parameters.CampaignsPageBannerImage))
    {
        <div class="hidden-xs hidden-sm col-md-9 col-lg-10 packagebanner banner-alt">
            @Html.Raw(Parameters.CampaignsPageBannerImage)
        </div>
    }
    @{
        Html.RenderAction("GetCampaignsPage", "Products", new { id = 0, brand = 0, sort = 2, order = 1, columncount = Parameters.CampaignsPageCampaignsColumnCount, campaigntype = "kampanya" });
    }
    @{
        Html.RenderAction("GetCampaignsPage", "Products", new { id = 0, brand = 0, sort = 2, order = 1, columncount = Parameters.CampaignsPageGiftsColumnCount, campaigntype = "hediye" });
    }
    @{
        Html.RenderAction("GetCampaignsPage", "Products", new { id = 0, brand = 0, sort = 2, order = 1, columncount = Parameters.CampaignsPageDiscountsColumnCount, campaigntype = "indirim" });
    }
</div>
<div class="@(suggestedClass)">
    @{Html.RenderAction("OurSuggestions", "Partials");}
</div>
@if (Parameters.WebSiteTrackingCode != "")
{ 
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '@Parameters.WebSiteTrackingCode']);
        _gaq.push(['_setDomainName', '@Parameters.WebSiteTrackingDomainName']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview']);

        (function ()
        {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>
}
<script type="text/javascript">
    function addToWishList(id)
    {
        $("#dialog-form").load("/WishList/List", { ProductId: id });
        $("#dialog-form").dialog("open");
    }
    $(function ()
    {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-form").dialog({
            autoOpen: false,
            height: 300,
            width: 550,
            modal: true,
            close: function ()
            {
                allFields.val("").removeClass("ui-state-error");
            }
        });
    });
    var selectedBrands = "";

    $('a.cgLink222').click(function ()
    {
        var qsId = $(this).attr('id').split("_")[1];
        $('#content').load('/Categories/Get', { id: qsId });
        return false;
    });
    $('a.prLink222').click(function ()
    {
        var qsId = $(this).attr('id').split("_")[1];
        $('#content').load('/Products/Get', { id: qsId });
        return false;
    });
    $('a.prdLink222').click(function ()
    {
        var qsId = $(this).attr('id').split("_")[1];
        $('#content').load('/Product/Get', { id: qsId, CategoryId: '@(Parameters.MainCategoryId)' });
        return false;
    });
    $('a.addToCart').click(function ()
    {
        var qsId = $(this).attr('id').split("_")[1];
        $('#cart').load('/Cart/Insert', { id: qsId });
        $('#sepetMinimalContent').load('/Cart/GetMinimal', { showPhotos: true, ShowAcrIcrLinks: true });
        $('body,html').animate({
            scrollTop: 0
        }, 800);
        $(".sepetFull img").delay(1000).fadeOut("slow").fadeIn("slow");
        return false;
    });
</script>
